package cn.tedu.micro.service.all.controller;

import cn.tedu.micro.service.all.service.OrderService;
import cn.tedu.micro.service.common.JsonResult;
import cn.tedu.micro.service.pojo.param.OrderAddParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/order")
public class OrderController {
    @Autowired
    private OrderService orderService;

    //新增订单
    @PostMapping("/add")
    public JsonResult addOrder(OrderAddParam orderAddParam){
        Boolean result = orderService.addOrder(orderAddParam);
        if(!result)
            return  JsonResult.fail("新增失败");
        return JsonResult.ok("新增成功");
    }
}
